import React from "react";
import { Pagination } from "antd";
import { on } from "events";
interface paginationProps {
  total?: number;
  align?: "start" | "center" | "end";
  hideOnSinglePage?: boolean;
  getData?: Function;
}
const App: React.FC<paginationProps> = (props) => {
  const {
    total = 0,
    align = "end",
    hideOnSinglePage = true,
    getData = () => {},
  } = props;
  const onChange = (page: any, pageSize: any) => {
    console.log("page: ", page, "pageSize: ", pageSize);
  };
  return (
    <Pagination
      align={align}
      total={total}
      hideOnSinglePage={hideOnSinglePage}
      showTotal={(total) => `共计 ${total} `}
      defaultPageSize={20}
      defaultCurrent={1}
      onChange={onChange}
    />
  );
};

export default App;
